﻿<%@ Page Language="C#" Inherits="E.Web.Teacher.publics.certificate.Relation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
  <title>认证与课程</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
  <link rel="stylesheet" href="/css/main.css" type="text/css" media="all" />
  <link rel="stylesheet" href="/css/t_main.css" type="text/css" media="all" />
  <script type="text/javascript" src="/js/jquery-1.4.2.min.js"></script>
  <script type="text/javascript" src="/js/Common.js"></script>
  <script type="text/javascript">
    function CheckForm() {
      var err = false;
      var courseArr = [];
      var courseIsChecked = false;
      var courseList = document.getElementsByName("CourseChb");
      for (var i = 0; i < courseList.length; i++) {
        if ($("#CourseChb_" + i)[0].checked) {
          courseIsChecked = true;
          courseArr.push($("#CourseChb_" + i).val());
        }
      }

      if (!courseIsChecked) {
        alert("请至少选择一门课程");
        err = true;
      }

      $("#course_v").val(courseArr);

      if (err) {
        return false;
      } else {
        return true;
      }
    }
  </script>
  <style type="text/css">    
    .left_2{ line-height:20px; _line-height:23px; width:400px; }
    .c_chb{ margin-top:2px; _margin-top:3px; width:20px; }
    .s2{ width:430px; }
  </style>
</head>
<body>
  <form id="form1" action="" method="post">
    <div class="m_top"></div>
    <div class="block_2">
      <div style="width:650px; height:22px;">
        <div class="title">&nbsp;认证与课程</div>
      </div>
      <div class="spe_line_2"></div>
      <div class="box_1">
        <div class="fl tr left">认证名称：</div>
        <div class="fl dis_r"><%=model.Name %></div>
      </div>
      <div class="box_1">
        <div class="fl tr left">课程列表：</div>
        <div class="fl dis_r">
          <ul>
          <% if (courseList != null && courseList.Count > 0) { %>
            <% int i = 0; %>
            <% foreach (System.Collections.Generic.KeyValuePair<int, string> kvp in courseList) { %>
            <li><div class="s2"><input type="checkbox" id="CourseChb_<%=i %>" name="CourseChb" class="fl c_chb" value="<%=kvp.Key %>" /><div class="fl left_2">&nbsp;<%=kvp.Value %></div></div></li>
            <% i++; %>
            <% } %>
          <% } %>
          </ul>
        </div>
      </div>
    </div>
    <div class="block">
      <div style="width:350px; margin-top:20px; text-align:center;">
        <input type="image" src="/images/btn/confirm.gif" style="width:52px; height:22px;" onclick="return CheckForm();" />
        &nbsp;&nbsp;<a href="/publics/certificate/List.aspx"><img alt="" src="/images/btn/back.gif" /></a>
      </div>
    </div>
      <input type="hidden" id="id" name="id" value="<%=id %>" />
      <input type="hidden" id="chk_v" name="chk_v" />
      <input type="hidden" id="course_v" name="course_v" value="<%=course_v %>" />
      <script type="text/javascript">
        InitCheckBoxData("course_v", "CourseChb", "CourseChb_");
      </script>
  </form>
</body>
</html>
